'''
Created on Aug 22, 2013

@author: marchi
'''
import copy

class MyData(object):
    '''
    classdocs
    '''
    def __init__(self,n):
        self.data=[];
        for o in range(n):
            self.data.append(0.0);    
    def __add__(self,other):
        assert len(other.data) == len(self.data);
        for o in range(len(other.data)):
            self.data[o]+=other.data[o];
        return self;
    def copy(self,data):
        assert len(data) == len(self.data);
        self.data=copy.copy(data);
    def __str__(self):
        return str(self.data);
    def __div__(self,num):
        if isinstance(num, int):
            div=float(num);
        elif isinstance(num, float):
            div=num;
        else:
            raise TypeError("unsupported operand type(s) for +: '{}' and '{}'").format(self.__class__, type(num))
        for i,c in enumerate(self.data):
            self.data[i]=c/div;
        return self;
        
        
        